<?php
namespace app\admin\model;

use think\Model;
use think\Db;
use traits\model\SoftDelete;
use app\admin\model\LabelModel;
//标签
class GoodsModel extends BaseModel
{   
	// 设置当前模型对应的完整数据表名称
    protected $table = 'goods';
    protected $pk = 'id';
    protected $append=['label'];  //追加字段
    protected $type = [];
    public function getLabelAttr($value,$data){
        if(isset($data['cid']) && $data['cid']){
            return LabelModel::get($data['cid']);
        }
        return 0;
    }
}
